<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="embed/template.xhtml">
                
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <ui:define name="topnav">
            <ui:include src="/embed/menu.xhtml">
                <ui:param name="page" value="home" />
            </ui:include>
   </ui:define> 
   
    <ui:define name="sidebar">
       <!--  <ui:include src="/login/login.xhtml" />-->
   </ui:define>
   <ui:define name="search">   
       <ui:include src="/embed/search.xhtml" />
    </ui:define>

        <ui:define name="body">
          <div class="productbox" >
            <h1>确认订单</h1>
            
            <f:subview id="no_order" rendered="#{currentOrder==null}">
                <p>你没有订购任何东西!</p>
            </f:subview>

            <f:subview id="orderdetail" rendered="#{currentOrder != null}">
                <h:form>
                    <h:dataTable value="#{currentOrder.orderitems}" var="line"
                                 styleClass="dvdtable" 
                                 headerClass="dvdtablehead"
                                 rowClasses="dvdtableodd,dvdtableeven"
                                 columnClasses="dvdtablecol">
                                               
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.cartColorColumn}" />
                            </f:facet>
                            <h:outputText value="#{line.product.color}"/>
                        </h:column> 
                        
                         <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.cartSizeColumn}" />
                            </f:facet>
                            <h:outputText value="#{line.product.size}"/>
                        </h:column> 
                         <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.cartPriceColumn}" />
                            </f:facet>
                            <h:outputText value="#{line.product.price}">
                                <f:convertNumber type="currency" currencySymbol="￥" />
                            </h:outputText>
                        </h:column>                        
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.cartQuantityColumn}" />
                            </f:facet>
                            <h:outputText value="#{line.itemNumber}"/>
                        </h:column>                        
                    </h:dataTable>
                </h:form>
                
                <div style="width: 30%;">
                    <div class="cntInfo" style="float:none;">
                        <h:panelGrid columns="2">
                            <h:outputText value="#{messages.checkoutSubtotal}" />
                            <h:outputText value="#{currentOrder.totalprice}">
                                <f:convertNumber type="currency" currencySymbol="￥" />
                            </h:outputText>                                                     
                        </h:panelGrid>
                        
                        <h:form>
                             <h:commandButton action="Addressinfo" value="填写订单信息" />
                            
                            &#160;
                            <h:commandButton action="cancel" value="取消" />
                        </h:form>
                    </div>
                </div>
            </f:subview> 
             </div>           
        </ui:define>
    </ui:composition>

